package service;

import dao.AnimalDao;
import entity.Animal;

import java.util.List;

public class AnimalService {
    private AnimalDao animalDao = new AnimalDao();

    // 获取所有动物
    public List<Animal> getAllAnimals() {
        return animalDao.getAllAnimals();
    }

    // 根据ID获取动物详情
    public Animal getAnimalById(int animalId) {
        return animalDao.getAnimalById(animalId);
    }

    // 添加动物
    public boolean addAnimal(Animal animal) {
        return animalDao.addAnimal(animal);
    }


    //删除动物
    public boolean deleteAnimal(int animalId) {
        return animalDao.deleteAnimal(animalId);
    }
}
